package com.smartthinking.CICPNL.home.activity;

import java.util.ArrayList;
import java.util.Dictionary;

import android.app.Activity;
import android.content.Intent;
import android.content.res.Configuration;
import android.os.Bundle;
import android.view.View;
import android.view.Window;

import com.smartthinking.CICPNL.R;

public class Home extends Activity {

	private Intent intent;
	private ArrayList<Dictionary> Actividades;

	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.ui_home);
		// Abrir Splash Banner
		abrirSplashBanner();
	}

	public void onConfigurationChanged(Configuration newConfig) {
		super.onConfigurationChanged(newConfig);
		// Checks the orientation of the screen
		if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) {
			setContentView(R.layout.ui_home_h);
		} else if (newConfig.orientation == Configuration.ORIENTATION_PORTRAIT) {
			setContentView(R.layout.ui_home);
		}
	}

	public void abrirSplashBanner() {
		/** se obtiene datos **/
		Intent intent = new Intent(this, Splash.class);
		intent.putExtra("PUT_IMG_WEB", "PRINCIPAL");
		startActivity(intent);
	}

	public void abrirCalendario(View v) {
		intent = new Intent(Home.this, Calendario.class);
		startActivity(intent);
		// finish();
	}

	public void abrirInformacion(View v) {
		intent = new Intent(Home.this, InformacionMenu.class);
		startActivity(intent);
		// finish();
	}

	public void abrirHoteles(View v) {
		intent = new Intent(Home.this, Hoteles.class);
		intent.putExtra("PUT_TITULO", "Hoteles");
		startActivity(intent);
		// finish();
	}

	public void abrirRestaurantes(View v) {
		intent = new Intent(Home.this, Restaurantes.class);
		intent.putExtra("PUT_TITULO", "Restaurantes");
		startActivity(intent);
		// finish();
		// Intent intent = new Intent(Home.this,
		// ProveedoresPreferencialesDetalle.class);
		//
		// //clsDictionary.setDctionary(Actividades.get(position));
		//
		// intent.putExtra("putTITULO", "Restaurantes" );
		//
		// intent.putExtra("putCAT_CVE", "2" );
		// startActivity(intent);
	}

	public void abrirEventos(View v) {
		intent = new Intent(Home.this, Eventos.class);
		startActivity(intent);
		// finish();
	}

}